package com.example.administrator.a0017activityintenttovalue;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

public class Main2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);

        //获取传过来的数据
        TextView textView = findViewById(R.id.textView);
        Intent intent = getIntent();
        textView.setText("id="+intent.getIntExtra("id",0)+",title="+intent.getStringExtra("title"));

    }
}
